package com.cloud.feign.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 奶茶
 * Created by on 2018/3/19.
 */
@FeignClient(value = "service-hi",fallbackFactory = HystrixClientFallbackFactory.class)
public interface HelloService {

    /**
     * 通过@FeignClient（"服务名"），来指定调用哪个服务。比如在代码中调用了service-hi服务的“/hi”接口
     *
     * @param name
     * @return
     */
    @RequestMapping(value = "/hi")
    String sayHi(@RequestParam(value = "name") String name);
}
